package cn.edu.dz.excep;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.nio.file.FileAlreadyExistsException;

public class Test3 {
    public static void main(String[] args) {
        try{
            test03();

        }catch (Exception e){
            System.out.println(e);
        }
    }    public static void test03()  {
    int a=0;
    if(a==0){
        //手动
    throw  new NullPointerException("这里是手动进行的制造的异常");
    }
    }
    /*public static void test04() {
        try{test02();
        }catch(){}
    }
    */
    public static void test04() {
        try{test02();
        }catch(Exception e){
            System.out.println();
        }}
    public static void test02() {
        //对抛出异常进行处理
        try{
            test01();
        }catch (FileNotFoundException e){
            System.out.println(e);
        }
        }
//抛出异常
    public static void test01()throws FileNotFoundException {
        FileInputStream f1 =new FileInputStream("");
    }
}
